import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'

// 导入 store 的实例对象
import store from './store/store.js'

import uView from '@/uni_modules/uview-ui'
Vue.use(uView)

import { $http } from '@escook/request-miniprogram'

// import './static/iconfont/iconfont-weapp-icon.css'

uni.$http = $http

// 后端地址
// $http.baseUrl = 'https://www.uinav.com'
$http.baseUrl = 'http://8.130.114.82:5555'

// 请求拦截器
$http.beforeRequest = function(options) {
	uni.showLoading({
		title:'数据加载中...',
		duration:1500
	})
}

// 响应拦截器
$http.afterRequset = function() {
	uni.hideLoading()
}

// 自定义消息提示
uni.$showMsg = function(title = '数据加载失败!!!', duration = 1500) {
	uni.showLoading({
		title,
		duration,
		icon:'none'
	})
}

Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
  ...App,
  store,
})

app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif